package com.wsc.wsckeeper.model;

import java.util.List;

import com.wsc.wsckeeper.model.entity.AccountE;
import com.wsc.wsckeeper.model.entity.CardE;
import com.wsc.wsckeeper.model.entity.CardTypeE;
import com.wsc.wsckeeper.model.entity.CurrencyE;

public class KRuntimeModel {

	private static KRuntimeModel instance;

	private KRuntimeModel() {
	}

	public static KRuntimeModel getInstance() {
		if (instance == null) {
			instance = new KRuntimeModel();
		}
		return instance;
	}

	private volatile List<CardE> cards;
	private volatile List<AccountE> accounts;
	private volatile List<CardTypeE> cardsType;
	private volatile List<CurrencyE> currencies;
	
	public void cleanData() {
		cards = null;
		accounts = null;
		cardsType = null;
		currencies = null;
	}

	public synchronized List<CardE> getCards() {
		return cards;
	}

	public synchronized void setCards(List<CardE> cards) {
		this.cards = cards;
	}

	public synchronized List<AccountE> getAccounts() {
		return accounts;
	}

	public synchronized void setAccounts(List<AccountE> accounts) {
		this.accounts = accounts;
	}

	public List<CardTypeE> getCardsType() {
		return cardsType;
	}

	public void setCardsType(List<CardTypeE> cardsType) {
		this.cardsType = cardsType;
	}

	public List<CurrencyE> getCurrensy() {
		return currencies;
	}

	public void setCurrensy(List<CurrencyE> currencies) {
		this.currencies = currencies;
	}
}